<template>
  <div ref="chaoren">
     
  </div>
</template>

<script>
export default {
  name: '',
  mounted() {
    //获取DOM
    let cz = this.$refs.chaoren;
    //改变脚步的变量
    let step = 0;
    //开启定时器 
    setInterval(()=>{
       step++;
       if(step>3) step = 0;
       cz.style.backgroundPosition = -step * 25 +'px -76px';
    },50);
  },
}
</script>
<style scoped lang="scss">
   div{
       position: fixed;
       width:25px;
       height: 38px;
       background:url('./1.png');
       z-index:2000;
       background-position: 0px -76px;
       left:120px;
       transform: scale(1.5);

   }
</style>
